/**
 * elancom Corporation copy right 2012 - 2015  
 *   
 * $Header$
 * $Id$
 * $Author$
 * $Date$
 * $Revision$
 */
package com.elancom.framework.context.impl;

import com.elancom.framework.context.CurrentContext;
import com.elancom.framework.context.SessionContext;
import com.elancom.framework.context.UserContext;

/**
 * @author elancom
 * @date 2012-7-13
 */
public class StandardUserContext implements UserContext {
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.elancom.framework.context.UserContext#getUserId()
	 */
	@Override
	public String getUserId() {
		return (String) getSessionContext().getAttribute(USER_ID);
	}

	/**
	 * @return
	 */
	private SessionContext getSessionContext() {
		SessionContext sessionContext = CurrentContext.getContext().getSessionContext();
		return sessionContext;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.elancom.framework.context.UserContext#getUserCode()
	 */
	@Override
	public String getUserCode() {
		return (String) getSessionContext().getAttribute(USER_CODE);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.elancom.framework.context.UserContext#getUserAccount()
	 */
	@Override
	public String getUserAccount() {
		return (String) getSessionContext().getAttribute(USER_ACCOUNT);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.elancom.framework.context.UserContext#getEmail()
	 */
	@Override
	public String getUserEmail() {
		return (String) getSessionContext().getAttribute(USER_EMAIL);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.elancom.framework.context.UserContext#getMobile()
	 */
	@Override
	public String getUserMobile() {
		return (String) getSessionContext().getAttribute(USER_MOBILE);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.elancom.framework.context.UserContext#getUserNickName()
	 */
	@Override
	public String getUserNickName() {
		return (String) getSessionContext().getAttribute(USER_NICK_NAME);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.elancom.framework.context.UserContext#getUserName()
	 */
	@Override
	public String getUserName() {
		return (String) getSessionContext().getAttribute(USER_NAME);
	}
}
